import request from '@/utils/request';

interface FormDataType {
  [propName: string]: any;
}

const $http = (path: string, params: FormDataType, type: string = 'POST') => {
  if (type === 'POST') {
    return request(path, { method: type, data: params });
  }
  if (type === 'GET') {
    return request(path, { method: type, params });
  }
  return '';
};

// 取得实时统计-基础数据
export const realTimeBasicApi = (params: FormDataType): any =>
  // $http('/gl/report/station/realtime/basic', params);
  $http('/gl/report/station/realtime/fundBasic', params);

// 订单充值金额
export const getRechargeData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/rechargeByHour', params);

// 总出款额
export const getWithdrawData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/withdrawByHour', params);

// 会员输赢
export const getMemberWinData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/bettingWinByHour', params);

// 实际到账金额
export const getRechargePayAmountData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/rechargePayAmountByHour', params);

// 充值笔数
export const getRechargeCountData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/rechargeCountByHour', params);

// 提现笔数
export const getWithdrawCountData = (params: FormDataType): any =>
  $http('/gl/report/station/realtime/withdrawCountByHour', params);
